package com.hbt.feature_provider.dao;

import com.hbt.api.entity.Feature;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface FeatureMapper {
    @Insert("insert into sys_feature (feature, userid) values (#{param1}, #{param2})")
    public int addSysFeature(String feature, int userid);

    @Delete("delete from sys_feature where userid = #{userid}")
    public int delAllSysFeatureByUserid(int userid);

    @Select("select feature from sys_feature where userid = #{userid}")
    public List<String> getSysFeatures(int userid);

    public int insertFeature(Feature feature);

    @Select("select *from feature where descript = #{descript}")
    public Feature getFeature(Feature feature);
}
